t = codesters.Teacher()
background = t.get_parameters_for_function("set_background")
try:
tval_1 = background[0][0]
except:
tval_1 = "DNE"
try:
tval2 = stage.get_wait_time()
except:
tval2 = "DNE"
t1 = TestObjective()
t1.add_success(tval_1 == '"schoolentrance"', "Great job!")
t1.add_failure(tval_1 == "DNE", "Did you drag out the School Entrance tool?")
t1.add_creative(tval_1 != '"schoolentrance"' and tval_1 != "DNE", "Nice background!")
t2 = TestObjective()
t2.add_success(tval2 == 2, "Great Job!")
t2.add_failure(tval2 == 0, "Did you drag out a wait tool?")
t2.add_failure(tval2 == "DNE", "You did something else.")
t2.add_creative(tval2 != 2 and tval2 != 0 and tval2 != "DNE", "That's a nice amount of time to wait too!")
tester = TestManager()
tester.add_test_list([t1,t2])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)